package com.uit.project.bustrip.main;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.app.ListActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.widget.ArrayAdapter;

import com.uit.project.bustrip.R;
import com.uit.project.bustrip.adapter.UserListAdapter;
import com.uit.project.bustrip.bo.UserBOImpl;
import com.uit.project.bustrip.bointerface.UserBO;
import com.uit.project.bustrip.dao.UserDaoImpl;
import com.uit.project.bustrip.daointerface.UserDao;
import com.uit.project.bustrip.database.DBHelper;
import com.uit.project.bustrip.entity.User;

public class UserList extends ListActivity {

	ArrayAdapter<User> adapter;
	ArrayList<User> items;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		UserBO userBO = new UserBOImpl();
//		items = (ArrayList<User>) userBO.findAll();
		User user = new User();
		user.username = "Nhan";
		user.email = "Nhan@chemgio";
		user.numberphone = "0987654321";
		items = new ArrayList<User>();
		items.add(user);
		User user1 = new User();
		user1.username = "xuyen";
		user1.email = "xuyen@chemgio";
		user1.numberphone = "1234554321";
		items.add(user1);
		adapter = new UserListAdapter(this,items);
		setListAdapter(adapter);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.user_list, menu);
		return true;
	}

}
